

<template>
   
   <div>

      <div class='flex-row' style="padding: 1rem; color: #7b7b7b; font-size: 1rem;">
        <div class='flex-grow-1'>总人数：{{allNomber}}人</div>
      </div>

      <div style="width: 100%; height: 0.6rem; background-color: #e4e4e5; border-top:1px #cfcfcf solid; margin-top: 0.8rem;"></div>

     <group>

        <cell :title="item.nickname" v-for="(item,index) in list">
            <img slot="icon" style="display:block;margin-right:0.7rem;border-radius:20rem;width: 4rem;height: 4rem;" :src="item.avatar_url">
            <div style="color: #7b7b7b;font-size:0.8rem">{{item.addtime}}</div>
        </cell>

     </group>

     <div v-if="none" style="margin: 1rem auto; width: 50%; text-align: center; color:#7b7a7a ">暂无更多好友！</div>  
 
   </div>
  
</template>

<script>


import { base64} from 'vux'


export default {

  components: {
    base64
  },
  data () {
    return {
      
      list:'',
      none:false,
      allNomber:''
      
    }
  },
  methods:{
    
    
    //获取详情
    getDetail(){
    	
	    	this.$store.commit('updateLoadingStatus',true);
		    	
		    	this.$http.post(this.$store.state.api + 'userlogin/get-team',
		    	{
		    		access_token:this.access_token
		    	})
		    	.then((response) => {
		    		
		    		console.log(response)
				
				if(response.body.code == 0) {
					
					this.list = response.body[1].f_c
					this.allNomber = response.body[1].f_c.length
					
					if(this.list.length == 0){
						this.none = true
					}
					
				} else {
					
				}
				
				this.$store.commit('updateLoadingStatus',false);
					
				
				}, (response) => {
	                 
	                 
				});
    
    },
    
    //获取地址栏信息
	getUrlStr(name){
      let reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)","i");
      if(reg.test(window.location.href)){
        return unescape(RegExp.$2.replace(/\+/g," "))
      }
      return undefined
    },	
    
  },
  
  mounted() {

    var access_token = this.getUrlStr('access_token');
           var parentId = this.getUrlStr('parent_id');
           
            if(parentId == undefined){
              parentId = 0;
           }
           
           var uid = this.getUrlStr('uid');
           
           if(parentId.toString().indexOf('?') > 0){
           	 parentId = parentId.split('?')[0];
           }
           
           var locurl = location.href;
           locurl = base64.encode(locurl.split('?')[0]);
           
       
           if(access_token != undefined){
         
              localStorage.setItem("access_token",access_token); 
              localStorage.setItem("parent_id",this.getUrlStr('uid'));


           }
           
            if(localStorage.getItem('access_token') != null){
         
              this.$root.registerjudge();
              this.$root.getShare();
              
            }else{
            	
        	  this.$root.gotoWechat(locurl,parentId);
            }
           
    	   this.access_token = localStorage.getItem('access_token');
			
    this.getDetail();

  },


}


</script>


<style>

  
  
 


</style>
